// 导入用户集合
const { User } = require('../../../model/user');

module.exports = (req, res) => {
  const { id, state } = req.body
  const users = User.updateOne({_id: id}, {state}, (err, row) => {
    console.log('err', err)
    console.log('row', row)
    if(!err) {
      res.json({
        message: '更新成功!'
      })
    } else {
      res.status(403)
      res.json({
        log: err,
        message: '更新失败！'
      })
    }
  })
}